package cn.kgc.easybuy.controller;

import cn.kgc.easybuy.service.LoginService;
import cn.kgc.easybuy.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @program: yingzi-wants-to-sleep
 * @description:
 * @author: 敖成
 * @create: 2025-09-16 09:13
 **/
@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @GetMapping("/login")
    public AjaxResult login(String loginName, String password) {
        Map<String, Object> map = loginService.login(loginName, password);
        return AjaxResult.success().add("jwtData", map);
    }
}
